package com.xianniu.ltc.enums;

import lombok.Getter;

/**
 * @author wangruijie
 * @version 1.0
 * @description: < 重要程度 >
 * @date 2021/5/27 19:32
 */
@Getter
public enum HowImportantEnum {
    // 一级， 二级，三级，四级，五级
    ONE("012-0179f00272060004","019-017e521c5a7e0014"),
    TWO("012-0179f00272060005","019-017e521c840b0015"),
    THREE("012-0179f00272060007","019-017e521c92a30016"),
    FOUR("012-0179f00272060008","019-017e521ca1a10017"),
    FIVE("012-0179f00272060009","019-017e521cb34d0018");

    private String key;
    private String value;

    HowImportantEnum(String key, String value){
        this.key=key;
        this.value=value;
    }
    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param key
     * @return
     */
    public static HowImportantEnum getByKey(String key){

        for (HowImportantEnum color: values()) {
            if(color.getKey().equals(key)){
                return  color;
            }
        }
        return null;
    }

    /**
     * 自己定义一个静态方法,通过value返回枚举常量对象
     * @param value
     * @return
     */
    public static HowImportantEnum getByValue(String value){

        for (HowImportantEnum color: values()) {
            if(color.getValue().equals(value)){
                return color;
            }
        }
        return null;
    }
}
